from bisect import *


def check(mid: int):
    global a, b
    count = 0
    for i in range(n):
        count += bisect_right(b, mid - a[i])
        if count >= k: return True
    return False


n, m, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
l = a[0] + b[0]
r = a[-1] + b[-1]
while l < r:
    mid = (l + r) >> 1
    if check(mid):
        r = mid
    else:
        l = mid + 1
print(l)
